import sys

from PyQt5.QtWidgets import QMessageBox,QApplication


def openMessageBox():
    msgBox = QMessageBox()
    msgBox.setText(u'弹窗' )
    msgBox.addButton(QMessageBox.Ok)
    msgBox.addButton(QMessageBox.No)
    msgBox.addButton(QMessageBox.Cancel)  # 4194304
    ret = msgBox.exec_()
    print(ret)
    return ret

app=QApplication(sys.argv)
openMessageBox()
sys.exit(app.exec_())